package com.example.system.controller;

import com.example.common.Result;
import com.example.system.domain.UserLogin;
import com.example.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {

    @Autowired
    public UserService userService;

    @RequestMapping("/findById")
    public Result findByUser(String name, String password){

        return Result.success(userService.findByUser(name,password));
    }


    @PostMapping("/findByUser")
    public Result save(@RequestBody UserLogin data){
        String name = data.getSys_name();
        String password = data.getSys_password();
        Object list = userService.findByUser(name,password);
        return Result.success(list);
    }

}
